// 请求配置接口
export interface RequestConfig {
    url?: string;
    method?: "GET" | "POST" | "PUT" | "DELETE";
    header?: Record<string, any>;
    data?: any;
    params?: any;
    loading?: boolean;
    dataType?: string;
    responseType?: string;
    apiName?: string | null;
    is?: "yyc" | "yyc-pay" | "yyc-phone" | "yyc-face";
    complete?: (response: any) => void;
}

// 响应数据接口
export interface ResponseData<T = any> {
    code: number;
    data: T;
    msg?: string;
}

// 响应接口
export interface Response<T = any> {
    data: ResponseData<T>;
    statusCode: number;
    header: Record<string, any>;
}

// 拦截器函数类型
export type RequestInterceptor = (config: RequestConfig) => RequestConfig;
export type ResponseInterceptor = (response: Response, options: RequestConfig) => any;
